package com.xnyzc.lhy.statistics.controller.trajectory;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.statistics.entity.trajectory.OaDVehicleGpsHistory;
import com.xnyzc.lhy.statistics.entity.trajectory.OaSysTrajectory;
import com.xnyzc.lhy.statistics.service.trajectory.TrajectoryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 轨迹
 *
 * @author cuixiaojian
 * @date 2020-01-06 14:11
 */
@RestController
@RequestMapping("/trajectory")
public class TrajectoryController {

    @Autowired
    private TrajectoryService trajectoryService;

    /**************************************** || || 轨迹查询 || || *************************************************/

    @ApiOperation(value = "预估轨迹查询", notes = "预估轨迹查询")
    @GetMapping(value = "/getPredictedTrajectory")
    public Rv getPredictedTrajectory(String orderNo) {
        return trajectoryService.getPredictedTrajectory(orderNo);
    }

    @ApiOperation(value = "订单轨迹查询", notes = "订单轨迹查询")
    @GetMapping(value = "/getOrderTrajectory")
    public Rv getOrderTrajectory(String orderNo) {
        return trajectoryService.getOrderTrajectory(orderNo);
    }

    /**************************************** || || 轨迹保存 || || *************************************************/

    @ApiOperation(value = "预估轨迹保存", notes = "预估轨迹保存")
    @PostMapping(value = "/savePredictedTrajectory")
    public Rv savePredictedTrajectory(@RequestBody List<OaSysTrajectory> oaSysTrajectoryList) {
        return trajectoryService.savePredictedTrajectory(oaSysTrajectoryList);
    }

    @ApiOperation(value = "订单轨迹保存", notes = "订单轨迹保存")
    @PostMapping(value = "/saveOrderTrajectory")
    public Rv saveOrderTrajectory(@RequestBody List<OaDVehicleGpsHistory> oaDVehicleGpsHistoryList) {
        return trajectoryService.saveOrderTrajectory(oaDVehicleGpsHistoryList);
    }

}
